package com.lw.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 *  表定义层。
 *
 * @author lw
 * @since 2024年12月04日 22:36:05
 */
public class TbBigDataTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public static final TbBigDataTableDef TB_BIG_DATA = new TbBigDataTableDef();

    
    public final QueryColumn ID = new QueryColumn(this, "id");

    
    public final QueryColumn DESC = new QueryColumn(this, "desc");

    
    public final QueryColumn NAME = new QueryColumn(this, "name");

    
    public final QueryColumn OTHER = new QueryColumn(this, "other");

    
    public final QueryColumn ORDER_ID = new QueryColumn(this, "order_id");

    
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, NAME, DESC, CREATE_TIME, OTHER, ORDER_ID};

    public TbBigDataTableDef() {
        super("", "tb_big_data");
    }

    private TbBigDataTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TbBigDataTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TbBigDataTableDef("", "tb_big_data", alias));
    }

}
